package com.example.demo.Dao;

import com.example.demo.Model.BlogEntity;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticalMaper {


    @Insert("insert into blog (title,content,user_id) values(#{title},#{content},#{user_id})")
    public boolean insertBlog(BlogEntity blogEntity);

    @Select("select * from blog order by id desc")
    public List<BlogEntity> selectAllBlog();

    @Select("select * from blog where user_id=#{user_id} order by id desc")
    public List<BlogEntity>selectBlogbyuserid(int user_id);
}
